package com.qixiucoding.link.inherit;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.qixiucoding.link.AbstractLink;
import com.qixiucoding.strategy.IStrategy;
import com.qixiucoding.strategy.impl.AStrategy;

/**
 * @Author longhj
 * @Description TODO
 * @Date 2021/10/24 星期日 17:37
 */
public class StratLink {

    //获取文件加工
    private JSONArray getData(JSONObject jsonObject) {
        JSONArray array = jsonObject.getJSONArray("array");
        return array;
    }

    public JSONObject start(JSONObject json, AbstractLink link) {
        JSONArray data = getData(json);
        while (link!=null) {
            link.doDeal(data);
            link = link.next();
        }
        return json;
    }

}
